package com.fs.activiti5.vo;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

import org.activiti.engine.repository.ProcessDefinition;


@Data
public class ProcessDefinitionVo {
	private String id;
	private String name;
	private String key;
	private Integer version;
    private String diagramResourceName;
	private String resourceName;
	private String deploymentId;
	private String description;
	
	public static List<ProcessDefinitionVo> list(List<ProcessDefinition> vos){
		List<ProcessDefinitionVo> list = new ArrayList<>();
		for(ProcessDefinition d: vos){
			ProcessDefinitionVo v = new ProcessDefinitionVo();
			v.setId(d.getId());
			v.setName(d.getName());
			v.setKey(d.getKey());
			v.setVersion(d.getVersion());
			v.setDiagramResourceName(d.getDiagramResourceName());
			v.setResourceName(d.getResourceName());
			v.setDeploymentId(d.getDeploymentId());
			v.setDescription(d.getDescription());
			list.add(v);
		}
		return list;
	}
}
